#pragma once
#include "QD3D/QD3DResourcePack.h"
#include "QD3D/QD3DUtils.h"
#include <d3d11.h>

class ScanPrimitive
{
public:
	CONST_STRUCT_BEGIN(ConstVars)
		UINT totalElemNum;
	CONST_STRUCT_END

	ScanPrimitive (UINT elemNum,
			QD3DResourcePack *p_dataPack, UINT structSize,
			const std::string &structBufType);
	~ScanPrimitive ();

	void run (UINT elemNum = -1);

private:
	UINT _elemNum;

	ID3D11Buffer *_pGroupSizeDxConstBuf;

	QVector< QD3DResourcePack * > _tempPackPtrs;

	ID3D11ComputeShader *_pScanUpSweepCS;
	ID3D11ComputeShader *_pScanDownSweepCS;
};